# celery启动文件
import os

from celery import Celery


if not os.getenv('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'duomei_shop.settings.dev'

# 创建celery实例
celery_app = Celery('duomei_shop')


# 加载celery配置
celery_app.config_from_object('celery_tasks.config')

# # 自动注册celery任务
# celery_app.autodiscover_tasks(['celery_tasks.sms'])

# 自动注册celery任务
celery_app.autodiscover_tasks(['celery_tasks.sms', 'celery_tasks.emails'])